/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 * Description: remote rdma rma buffer implement
 */

#include "remote_rdma_rma_buffer_impl.h"
#include "adapter_rts.h"
#include "sal.h"
#include "device_capacity.h"
#include "hccl_network.h"

namespace hccl {
RemoteRdmaRmaBufferImpl::RemoteRdmaRmaBufferImpl()
    : RmaBuffer(nullptr, 0, HcclMemType::HCCL_MEM_TYPE_NUM, RmaType::RDMA_RMA)
{
}


RemoteRdmaRmaBufferImpl::~RemoteRdmaRmaBufferImpl()
{
}

HcclResult RemoteRdmaRmaBufferImpl::Deserialize(const std::string& msg)
{
    std::istringstream iss(msg);
    iss.read(reinterpret_cast<char_t *>(&rkey), sizeof(rkey));
    HCCL_DEBUG("[RemoteRdmaRmaBufferImpl][Deserialize]rkey[%u]", rkey);
    return HCCL_SUCCESS;
}
}